<template>
<div class="classic-dail">
    <app-scroll class="content">
        
        <div class="maoyan">
            <a href="">猫眼电影></a>
            <span>{{detail[0].nm}}</span>
        </div>
        <div class="main">
            <div class="imge">
                <img :src="detail[0].img" alt="">
            </div>
            <div class="title">
                <h1>{{detail[0].nm}}</h1>
                <div class="english">
                    {{detail[0].enm}}
                </div>
                <div class="leibie">
                    <span>{{detail[0].cat}}</span>
                    <h2>{{detail[0].version}}</h2>
                </div>
                <div class="actor">
                    {{detail[0].star}}
                </div>
                <div class="time">
                    {{detail[0].pubDesc}}
                </div>
                <div class="xihuan">
                    <span>想看</span>
                    <span>看过</span>
                </div>
            </div>
        </div>
        <div class="pingfen">
            <div class="top">
                <span>实时口碑</span>
                <h1 v-if="detail">{{detail[0].wish}}人想看</h1>
                <h2>{{detail[0].watched}}人看过</h2>
            </div>
            <div class="middle">
                <div class="left">
                    <span>{{detail[0].sc}}</span>
                    <h1>{{detail[0].snum}}人评论</h1>
                </div>
            </div>
            <div class="bottom">

            </div>
        </div>
        <div class="titles">
            <div class="top">
                <span>简介</span>
                <h1>展开</h1>
            </div>
            <div class="bottom">
                <span>{{detail[0].dra}}</span>
            </div>
        </div>
        <div class="actors">
            <div class="top">
                <span>演职人员</span>
                <h1>全部</h1>
            </div>
            <app-scroll-x :scrollX="true" :scrollY="false" class="main">
                <ul class="list" ref="wrap">
                    <li v-for="num in 14" :key="num">
                        <img :src="detail[0].img" alt="">
                    </li>
                </ul>
            </app-scroll-x>
            
        </div>
        <div class="juzhao">
            <div class="top">
                <span>剧照</span>
                <h1>全部</h1>
            </div>
            <app-scroll-x :scrollX="true" :scrollY="false"  class="main">
                <ul class="list">
                    <li v-for="(item,index) in detail[0].photos" :key="index">
                        <img :src="item" alt="">
                    </li>
                </ul>
            </app-scroll-x>
        </div>
    </app-scroll>
</div>
</template>

<script>
import { mapState } from 'vuex'
export default {
    data(){
      return{
          wrapWidth:0,
      }  
    },
    
    computed:{
        ...mapState({
            detail:state=>state.classicdail.detail
        })
    },
    watch:{
        detail(newVlue){
            console.log(newVlue);
        }
    },
    created(){
        this.$store.dispatch('classicdail/requestClassicDail',this.$route.params.id)
    }
}
</script>

<style lang='scss' scoped>
.classic-dail{
    position: absolute;
    top: -94px;
    left: 0;
    bottom: -50px;
    right: 0;
    background: #ffffff;
    z-index: 99;
    width: 100%;
    height: calc(100% + 94px);
    .content{
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        padding: 21px 16px;
        background: #403723;
        
        .maoyan{
            width: 343px;
            height: 21px;
            margin: 0 0 15px;
            color: #cccccc;
            a{
                color: #cccccc;
                font-size: 14px;
            }
            span{
                font-size: 14px;
            }
        }
        .main{
            width: 343px;
            height: 156px;
            display: flex;
            .imge{
                img{
                    width: 100px;
                    height: 138px;
                }
            } 
            .title{
                margin-left: 10px;
                width: 231px;
                 color: #ffffff;
                 font-size: 12px;
                h1{
                    width: 231px;
                    height: 30px;
                    color: #ffffff;
                    font-size: 20px;
                }
                .english{
                    width: 231px;
                    height: 18px;
                    font-size: 12px;
                }
                .leibie{
                    display: flex;
                    height: 18px;
                    h2{
                        margin-left: 5px;
                    }
                }
                .actor{
                    height: 18px;
                }
                .time{
                    height: 14px;
                }
                .xihuan{
                    margin-top: 10px;
                    span{
                        width: 110px;
                        height: 30px;
                        display: inline-block;
                        font-size: 14px;
                        line-height: 30px;
                        text-align: center;
                        border-radius: 5px;
                        background: #ffffff59;
                        margin-left: 5px;
                    }
                }
            }
        }
        .pingfen{
            height: 178.5px;
            background: #ffffff33;
            padding: 10px 12px;
            margin: 15px 0 0;
            .top{
                height: 18px;
                font-size: 12px;
                color: #ffffff;
                display: flex;
                h1{
                    margin-left: 80px;
                }
                h2{
                    margin-left: 10px;
                }
            }
            .middle{
                height: 130px;
                padding: 20px 0;
                box-sizing: border-box;
                .left{
                    margin-left: 130px;
                    margin-top: 30px;
                    span{
                        font-size: 34px;
                        color:#ffb440;
                        height: 40px;
                        width: 47.27px;
                    }
                    h1{
                        font-size: 12px;
                        color: #ffffff;
                    }
                }
            }
            .bottom{
                height: 10.5px;
            }
        }
        .titles{
            height: 130px;
            padding: 16px 0 0;
            display: flex;
            flex-direction: column;
            color: #ffffff;
            font-size: 15px;
            .top{
                height: 22px;
                display: flex;
                justify-content: space-between;
            }
            .bottom{
                // text-overflow: ellipsis;
                // overflow: hidden;
                // white-space: nowrap;
                height: 78px;
                margin: 7px 0;
            }
        }
        .actors{
            height: 181px;
            margin: 18px 0 15px;
            .top{
                height: 22px;
                font-size: 15px;
                color: #ffffff;
                display: flex;
                justify-content: space-between;
            }
            .main{
                .scroll-wrap{
                    width: max-width ;
                }
                .list{
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-wrap: nowrap;
                    width: max-content;
                    li{
                        margin-left: 5px;
                    }
                    img{
                        width: 80px;
                        height: 112px;
                    }
                }
            }
            
        }
        .juzhao{
            height: 200px;
            margin: 18px 0 0;
            box-sizing: border-box;
            .top{
                display: flex;
                justify-content: space-between;
                color: #ffffff;
                font-size: 15px;
                height: 22px;
            }
            .main{
                .scroll-wrap{
                    width: max-width ;
                }
                .list{
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    flex-wrap: nowrap;
                    width: max-content;
                    li{
                        margin-left: 10px;
                         img{
                            width: 140px;
                            height: 93px;
                        }
                    }
                   
                }
            }
        }
    }
}
</style>